package service

import (
	"goproject/src/globalvariable"
	"goproject/src/mapper"
	"goproject/src/model"
)

func GetAllOrdersPage(size string, page string) []model.DesOrder {
	db := globalvariable.MysqlDB
	return mapper.GetAllOrders(size, page, db)
}

func DeleteOrderById(id string) {
	db := globalvariable.MysqlDB
	mapper.DeleteOrderById(db, id)
}

func QueryOrderTotals() int64 {
	db := globalvariable.MysqlDB
	return mapper.QueryOrderTotals(db)
}

func GetAllOrdersFilter(orderName string) []model.DesOrder {
	db := globalvariable.MysqlDB
	return mapper.GetAllOrdersFilter(db, orderName)
}
